home *** CD-ROM | disk | FTP | other *** search
- -- background: 55571 from stack: in
- -- bmap block id: 55889
- -- flags: 0000
- -- background id: 0
- -- name: VideoList
- ----- HyperTalk script -----
- --++--++--++ VIDEO SCRIPTS - Version 8 --++--++--++
- on playScene sceneNumber
- global gDiscSide, gPlayerOffset, gPlayerType
- global gVideoFirstFrame, gVideoLastFrame
- global gTimeRemaining
- global gVideoLastCommand
- put "play" into gVideoLastCommand
- put char 1 of sceneNumber into newSide
- if newSide <> gDiscSide then
- swapSide newSide
- end if
- if gDiscSide is "none" then exit playScene -- user chose no video
- checkVideoRunning
- delete char 1 of sceneNumber
- put line sceneNumber of fld "Start#" of cd "videoList" into startNum
- put line sceneNumber of fld "Stop#" of cd "videoList" into stopNum
- put line sceneNumber of fld "PlayWhat" of cd "videoList" into playWhat
-
- if gPlayerType = "ODR" then
- add gPlayerOffset to startNum
- if stopNum <> "-" then add gPlayerOffset to stopNum
- end if
-
- turnStereoOff
-
- if (playWhat contains "A1" and playWhat contains "A2") then
- turnStereoOn
- else if playWhat contains "A1" then
- turnAudioOn 1
- else if playWhat contains "A2" then
- turnAudioOn 2
- end if
-
- searchVideo startNum
- if playWhat contains "V" then
- turnVideoOn
- else
- turnVideoOff
- end if
-
- if stopNum <> "-" then
- playVideo startNum,stopNum
- -- create a controller
- if ((stopNum - startNum) > 60) then
- if not (playWhat contains "N") then makeVideoController
- put lengthFrames(stopNum - startNum) into gTimeRemaining
- else
- put empty into gTimeRemaining
- end if
- put startNum into gVideoFirstFrame
- put stopNum into gVideoLastFrame
- set cursor to hand
- --waitForMouseClick
- end if
- end playScene
-
- on introScene sceneNumber,numScreens
- global gDiscSide, gPlayerOffset, gPlayerType
- global gVideoLastCommand
- put "Pause" into gVideoLastCommand
- if gDiscSide is "none" then exit introScene -- user chose no video
- put char 1 of sceneNumber into newSide
- if newSide <> gDiscSide then
- swapSide newSide
- end if
- if gDiscSide is "none" then exit introScene -- user chose no video
- checkVideoRunning
- delete char 1 of sceneNumber
- put line sceneNumber of fld "Start#" of cd "videoList" into startNum
-
- if gPlayerType = "ODR" then
- add gPlayerOffset to startNum
- end if
-
- searchVideo startNum
- turnVideoOn
-
- end introScene
-
- on swapSide newSide
- global gDiscSide
- if gDiscSide is "none" or gDiscSide is empty then -- initialize the player
- put newSide into gDiscSide
- startVideoDiscPlayer
- end if
- if gDiscSide is "none" then -- user chose no video
- exit swapSide
- end if
- if checkDiscSide(newSide) then
- put newSide into gDiscSide
- --introScene (gDiscSide & (sideNumber(gDiscSide) + 1))
- end if
- end swapSide
-
- on checkVideoRunning
- global gDiscSide
- if gDiscSide = "none" then exit checkVideoRunning
- set cursor to watch
- get videostatus()
- if it is "noAnswer" or it is "abort" then
- wait 60 ticks
- startVideoDiscPlayer
- else if it contains "park" then
- controlVideo reset,audio1on,pictureOn,framesOff
- end if
- end checkVideoRunning
-
- on startVideoDiscPlayer
- global gVideodiscPlayer
- if gVideoDiscPlayer is empty then --this is here just for testers
- put "Pioneer 4200" into gVideoDiscPlayer
- end if
- setVideoPlayer gVideodiscPlayer -- set the player to the stored global
- set cursor to watch
- get videoStatus()
- if it is not "noAnswer" and it is not "abort" then
- -- player is turned on.
- controlVideo reset,audio1on,pictureOn,framesOff
- else
- -- didn't turn on. Tell them to try again or cancel the video.
- if tryAgain() is false then
- -- skip the video
- else
- get videoStatus()
- if it is not "noAnswer" and it is not "abort" then
- -- player is turned on.
- controlVideo reset,audio1on,pictureOn,framesOff
- else
- put "You still haven't turned on the videodisc player."&& "The course will continue without video." into string
- answer string with "OK"
- setNoVideo
- return false
- end if
- end if
- end if
- end startVideoDiscPLayer
-
- --/ warn that the video is not connected and give them the choice of
- --/ skipping it entirely
- function TryAgain
- global gVideoDiscPlayer
- put "Please connect the" && gVideodiscPlayer && "player. " into prompt
- put return & "Click “No video” if you don’t plan to use the video." after prompt
- answer prompt with "No video" or "OK"
- if it is "OK" then
- return true
- else
- setNoVideo
- return false
- end if
- end TryAgain
-
- on setNoVideo
- global gDiscSide
- put "none" into gDiscSide
- end setNovideo
-
- function lengthScene sceneNum
- global startNums, stopNums, loopNums
- put line sceneNum of stopNums into endFrame
- if item 1 of line sceneNum of loopNums <> "-" then
- put item 1 of line sceneNum of loopNums into endFrame
- end if
- put (endFrame - (line sceneNum of startNums)) into numFrames
- return trunc(numFrames/30)+1
- end lengthScene
-
- function lengthFrames numFrames
- return trunc(numFrames/30)+1
- end lengthFrames
-
- function checkDiscSide wantSide
- put sideNumber(wantSide) into userWantSide
- get videoChapter()
- if it <> userWantSide then
- controlVideo eject -- be helpful, eject the disc
- put "Please insert Side" && userWantSide & ", then click OK." into string
- answer string with "OK"
- refresh
-
- controlVideo reset -- look again
- wait 45 -- to see the side number
- get videoChapter()
- if it = userWantSide then
- controlVideo reset
- return "true"
- else
- controlVideo eject
- put "Please insert Side" && userwantSide & " into the videodisc player, or click “No video”"&& "to continue the course without video." into string
- answer string with "No video" or "OK"
- refresh
- if it is "No video" then
- setNoVideo
- return false
- else
- controlVideo reset
- get videoChapter()
- if it = userWantSide then
- controlVideo reset
- return "true"
- else
- setNoVideo
- put "You still haven’t inserted the right videodisc."&& "The course will continue without video." into string
- answer string with OK
- return false -- 2 tries is all they get
- end if
- end if
- end if
- else
- return true
- end if
- end checkDiscSide
-
- function sideNumber sideName
- put charToNum(sideName) - charToNum("A") + 1 into temp
- return temp
- end sideNumber
-
- on refresh -- for use with checkDiscside askdialogs
- go this cd
- unlock screen
- lock screen
- end refresh
-
- on gv
- global gPlayerType
- if gPlayerType = "ODR" then
- openModemPort
- chkOnLine
- else
- setVideoPlayer gPlayerType
- controlvideo reset,audio1On,pictureOn,framesOff,baud4800
- end if
- end gv
-
- on initFrames
- global gDiscSide, gPlayerOffset, gPlayerType
- put fld "PlayerOffset" into gPlayerOffset
- put fld "PlayerType" into gPlayerType
- put fld "discSide" into gDiscSide
- end initFrames
-
- on Cmd
- global inframe,outframe,speed,etx,stx
- put the param of 1 into cmd
- IF the PARAMCOUNT >1 THEN PUT the param of 2 & ":" after cmd
- IF the PARAMCOUNT >2 THEN PUT the param of 3 & ":" after cmd
- sendsport (stx & cmd & etx & return)
- end cmd
-
- on openModemPort
- closeSport
- ConfigureSPort modemport,baud600,stop10,data8,parityoff, xonoutoff,linefeedsoff,echooff,editoff,stripoff
- end openModemPort
-
- on openPrinterPort
- closeSport
- ConfigureSPort port2,baud600,stop10,data8,parityoff, xonoutoff,linefeedsoff,echooff,editoff,stripoff
- end openPrinterPort
-
- on chkOnline
- cmd "ON12:"
- put empty into old
- put recvUpTo(ETX,10,old) into temp
- IF OFFSET ("ON",temp) > 0 THEN
- exit chkOnline
- else
- answer "ODR is not responding - Check for RUN mode ON" with "Cancel" or "Try Again"
- if it is "Cancel" then exit chkOnline
- else chkonline
- end if
- end chkOnline
-
- on playVideo startFrame,stopFrame
- global gPlayerType
- if gPlayerType = "ODR" then
- cmd AC -- clear everything
- cmd SR,startFrame -- search to the first
- cmd PF,stopFrame -- play forward to the last
- else
- pass playVideo
- end if
- end playVideo
-
- on searchVideo startFrame
- global gPlayerType
- if gPlayerType = "ODR" then
- cmd AC
- cmd SR, startFrame
- else
- pass searchVideo
- end if
- end searchVideo
-
- on turnVideoOn
- global gPlayerType
- if gPlayerType is "ODR" then
- cmd VS
- else
- controlVideo pictureOn
- end if
- end turnVideoOn
-
- on turnVideoOff
- global gPlayerType, gDiscSide
- if gDiscSide = "none" then exit turnVideoOff
- if gPlayerType is "ODR" then
- cmd VR
- else
- controlVideo pictureOff
- end if
- end turnVideoOff
-
- on turnAudioOn channel
- global gPlayerType
- if channel is empty then
- if gPlayerType is "ODR" then
- cmd AS
- else
- controlVideo audio1on,audio2on
- end if
- else
- if gPlayerType is "ODR" then
- put "A"&channel into temp
- cmd temp,32000
- else
- put "audio"&channel&"on" into temp
- controlVideo temp
- end if
- end if
- end turnAudioOn
-
- on turnAudioOff channel
- global gPlayerType
- if channel is empty then
- if gPlayerType is "ODR" then
- cmd AR
- else
- controlVideo audioOff
- end if
- else
- if gPlayerType is "ODR" then
- put "A"&channel into temp
- cmd temp
- else
- put "audio"&channel&"off" into temp
- controlVideo temp
- end if
- end if
- end turnAudioOff
-
- on turnStereoOn
- controlVideo stereoOn
- end turnStereoOn
-
- on turnStereoOff
- controlVideo audiooff
- end turnStereoOff
-
- on xy
- repeat until the mouse is down
- put the mouseloc
- end repeat
- end xy
-
- on updateScroll
- global initScroll
- repeat with i = 2 to 6
- set the scroll of bkgnd field i to initscroll
- end repeat
- end updateScroll
-
- on tabKey
- get the selectedLine
- --put return after it
- if value(it) = empty then
- put "put ""e&"-""e&" into "&it into cmd
- do cmd
- end if
- if word 6 of it = 6 then
- put 3 into word 6 of it
- add 1 to word 2 of it
- else
- add 1 to word 6 of it
- end if
- select it
- end tabKey
-
- ---------copyright Apple Computer Inc 1989
-
- function lenWait secs
- get char 7 to 8 of frameToTime(secs)
- return it+1
- end lenWait
-
- -- interpreter
- function videoframe
- global gPlayerType
- if gPlayerType is "ODR" then
- cmd "ON14:"
- global framenum,etx
- put empty into framenum
- put empty into old
- killsport in
- cmd NO
- put recvUpTo(ETX,4,old) into temp
- get offset("NO",temp)
- put char it + 2 to it + 6 of temp into framenum
- put temp
- -- if framenum is empty then beep
- return framenum
- else
- pass videoframe
- end if
- end videoframe
-
- on scanVideo direction
- global gPlayerType
- if gPlayerType is "ODR" then
- if direction is "backward" then
- cmd CR
- else cmd CF
- else
- pass scanVideo
- end if
- end scanVideo
-
- on stepVideo numberFrames, count
- global gPlayerType
- if gPlayerType is "ODR" then
- -- goes the numberFrames at a time, count times
- put cmd NO in currentFrame
-
- put currentFrame + numberFrames into finalFrame
- if numberFrames is > 0 then
- cmd TF,1,finalFrame -- step for 1 seconds
- else
- cmd TR,1,finalFrame
- end if
- else
- pass stepVideo
- end if
- end stepVideo
-
- -- end interpreter
- --++--++--++ VIDEO SCRIPTS - Version 8 --++--++--++
-
-
-
- -- part 1 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=89 top=36 right=53 bottom=123
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: PlayerOffset
-
-
- -- part 3 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=10 top=89 right=332 bottom=67
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Number
- ----- HyperTalk script -----
- on mouseWithin
- global initscroll
- if the scroll of me <> initscroll then
- put the scroll of me into initscroll
- updateScroll
- end if
- end mouseWithin
-
- on mouseUp
- get the rect of me
- put item 2 of it into FieldPos
- get the textHeight of me
- put it into EachLine
- get the mouseLoc
- put item 2 of it into btnCenter
- put the scroll of me into scrollValue
- put trunc((btnCenter + EachLine + scrollValue - FieldPos)/EachLine) into ClickLine
- get line clickLine of me
- playScene it
- end mouseUp
-
-
- -- part 4 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=50 top=89 right=332 bottom=123
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Start#
- ----- HyperTalk script -----
- on mouseWithin
- global initscroll
- if the scroll of me <> initscroll then
- put the scroll of me into initscroll
- updateScroll
- end if
- end mouseWithin
-
- on enterinfield
- tabkey
- end enterinfield
-
- on closefield
- initframes
- end closefield
-
-
- -- part 5 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=100 top=89 right=332 bottom=169
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Stop#
- ----- HyperTalk script -----
- on mouseWithin
- global initscroll
- if the scroll of me <> initscroll then
- put the scroll of me into initscroll
- updateScroll
- end if
- end mouseWithin
-
- on enterinfield
- tabkey
- end enterinfield
-
- on enterinfield
- get the selectedline
- put value(it)
- put 3 into word 6 of it
- add 1 to word 2 of it
- select it
- end enterinfield
-
-
- -- part 6 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=149 top=89 right=332 bottom=426
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 10
- -- style flags: 0
- -- line height: 16
- -- part name: Title
- ----- HyperTalk script -----
- on mouseWithin
- global initscroll
- if the scroll of me <> initscroll then
- put the scroll of me into initscroll
- updateScroll
- end if
- end mouseWithin
-
- on enterinfield
- tabkey
- end enterinfield
-
-
- -- part 8 (field)
- -- low flags: 01
- -- high flags: 0007
- -- rect: left=407 top=89 right=332 bottom=471
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 10
- -- style flags: 0
- -- line height: 16
- -- part name: PlayWhat
- ----- HyperTalk script -----
- on mouseWithin
- global initscroll
- if the scroll of me <> initscroll then
- put the scroll of me into initscroll
- updateScroll
- end if
- end mouseWithin
-
-
- -- part 9 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=9 top=36 right=53 bottom=87
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: PlayerType
- ----- HyperTalk script -----
- on mouseDown
- global playerType
- put "ODR;Pioneer 4200" into status
- put "ODR,Pioneer 4200" into statusNames
- put the mouseloc into myPlace
- put item 1 of myPlace +(the left of cd window) into horiz
- put item 2 of myPlace +(the top of cd window) into vert
- put 0 into checkitem
- if bg fld "PlayerType" contains "ODR" then put 1 into checkitem
- if bg fld "PlayerType" contains "Pioneer 4200" then put 2 into checkitem
- get PopUpMenu(status, checkitem, vert, horiz)
- if it <> 0 then put item it of statusNames into bg fld "PlayerType"
- put bg fld "PlayerType" into playerType
- end mouseDown
-
-
- -- part 17 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=7 top=22 right=40 bottom=100
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Get start
- ----- HyperTalk script -----
- on mouseUp
- get videoFrame()
- if it is not empty then
- put return&it after fld "Start#"
- end if
- end mouseUp
-
-
- -- part 19 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=7 top=41 right=59 bottom=100
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Get stop
- ----- HyperTalk script -----
- on mouseUp
- get videoFrame()
- if it is not empty then
- put return&it after fld "Stop#"
- end if
- end mouseUp
-
-
-
- -- part 34 (field)
- -- low flags: 01
- -- high flags: 2000
- -- rect: left=0 top=0 right=35 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 158
- -- text size: 24
- -- style flags: 10240
- -- line height: 24
- -- part name: Title
-
-
- -- part 25 (field)
- -- low flags: 01
- -- high flags: 2000
- -- rect: left=213 top=0 right=35 bottom=247
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 158
- -- text size: 24
- -- style flags: 10240
- -- line height: 24
- -- part name: discSide
-
-
- -- part 26 (button)
- -- low flags: 80
- -- high flags: A004
- -- rect: left=108 top=41 right=58 bottom=169
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Erase
- ----- HyperTalk script -----
- on mouseUp
- answer "Are you sure ?" with "Yes" or "No"
- if it is "Yes" then
- put empty into bg fld "Number"
- put empty into bg fld "Start#"
- put empty into bg fld "Stop#"
- put empty into bg fld "Title"
- put empty into bg fld "PlayWhat"
- end if
- end mouseUp
-
-
-
- -- part 33 (button)
- -- low flags: 00
- -- high flags: A002
- -- rect: left=9 top=56 right=71 bottom=75
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 241
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: InitFrames
- ----- HyperTalk script -----
- on mouseUp
- initframes
- end mouseUp
-
-
-
- -- part 38 (field)
- -- low flags: 01
- -- high flags: 0000
- -- rect: left=458 top=8 right=32 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 241
- -- text size: 14
- -- style flags: 2048
- -- line height: 18
- -- part name: version
-
-
- -- part 41 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=486 top=34 right=63 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: options
- ----- HyperTalk script -----
- on mouseUp
- options
- end mouseUp
-
-
-
- -- part 42 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=486 top=107 right=135 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: panic
- ----- HyperTalk script -----
- on mouseUp
- goPanic
- end mouseUp
-
-
-
- -- part 43 (button)
- -- low flags: 00
- -- high flags: 2000
- -- rect: left=487 top=221 right=242 bottom=508
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: up
- ----- HyperTalk script -----
- on mouseUp
- goUp
- end mouseUp
-
-